package com.only4play.practice.message.core.checker;

import cn.hutool.extra.spring.SpringUtil;
import com.only4play.practice.message.core.service.IVerifyRecordService;
import net.bytebuddy.matcher.ElementMatcher;

public class SendMaxTimesChecker implements ElementMatcher<CheckContext> {

  @Override
  public boolean matches(CheckContext checkContext) {
    IVerifyRecordService recordService = SpringUtil.getBean(IVerifyRecordService.class);
    return recordService.checkSendMaxTimes(checkContext.getAccount(), checkContext.getTemplateCode());
  }
}
